#include "dialog.h"
#include "ui_dialog.h"
#include <QIcon>

Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui->setupUi(this);

    this->setWindowTitle("这是一个对话框");

    // :/img/item1_48.png
    // QIcon icon(":/img/item1_48.png");
    // QIcon icon(":/img/item1_64.png");
    QIcon icon(":/img/item1_128.png");
    // icon.pixmap(128,128);
    QPixmap pixmap = icon.pixmap(32, 32); // 获取 32x32 像素的图标版本

    this->setWindowIcon(pixmap);
}

Dialog::~Dialog()
{
    delete ui;
}

// 确定
void Dialog::on_pushButton_2_clicked()
{
    this->close();
}

// 取消
void Dialog::on_pushButton_3_clicked()
{
    this->close();
}
